<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CreatePostsTable extends Migrator
{
    public function up()
    {
        $this->table('posts')
            ->addColumn('title', 'string')
            ->addColumn('content', 'text')
            ->addColumn('create_time', 'timestamp')
            ->addColumn('update_time', 'timestamp')
            ->save();
    }

    public function down()
    {
        $this->dropTable('posts');
    }
}
